package miku.firstgame.net.pack
{
	import flash.utils.ByteArray;

	import miku.firstgame.constrants.ProtocalConstants;
	import miku.firstgame.entity.Bomb;
	import miku.firstgame.net.ByteArrayEx;

	public class SetRoadCardRequestPack extends AbstractRequestPack
	{
		public var cardType:int
		public var x:int;
		public var y:int;
		public var togged:Boolean;

		public function SetRoadCardRequestPack()
		{
			super();
		}

		override public function encode():ByteArray
		{
			var data:ByteArrayEx = new ByteArrayEx();
			data.writeUnsignedInt(13);
			data.writeShort(tag);
			data.writeShort(0);

			data.writeInt(cardType);
			data.writeShort(x);
			data.writeShort(y);
			data.writeByte(togged ? 0 : 1);
			data.position = 0;
			return data;
		}

		override public function get tag():int
		{
			return ProtocalConstants.SET_ROAD_CARD;
		}
	}
}
